#########################################################################
# File Name: apply.sh
# Author: asia.rabbit
# mail: asia.rabbit@163.com
# Created Time: Fri 11 Aug 2023 07:58:31 PM CST
#########################################################################
#!/bin/bash

fs=("192.168.0.111" "192.168.0.100" "192.168.0.101" "192.168.0.102" "192.168.0.105")
dst=/home/trunk/build/ln_config_file/

# clear the config files
for i in ${fs[@]}; do
  if [ -f $i ]; then
    rm $i
  fi
done

# generate the config files according to ./my.yaml
make re
./re

# transmit the config files
for i in ${fs[@]}; do
  if [ -f $i ]; then
    scp $i cmc:$dst
  fi
done
